/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.chain.of.responsibility;

/**
 * 责任链的好处：当客户提交一个请求时，请求是沿恋传递至有权限处理他的地方
 * @author caicongyang1
 * @version id: ChainOfResClientTest, v 0.1 17/5/19 下午7:24 caicongyang1 Exp $$
 */
public class ChainOfResClientTest {

    public static void main(String[] args) {
        Handler h0 = new CommonHandler("员工小蔡");
        Handler h1 = new ConcreteHandler("项目经理");
        Handler h2 = new SuperConcreteHandler("CTO");
        h0.setSuperior(h1);
        h1.setSuperior(h2);

        h0.handldRequest("请假");
        h0.handldRequest("加薪");

    }
}
